package net.btd.city.tools;

import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.*;

public class Tools {

        public Tools() {
        }

        public static byte[] str2Bytes(String s) {
                ByteArrayOutputStream bytearrayoutputstream;
                bytearrayoutputstream = new ByteArrayOutputStream();
                DataOutputStream dataoutputstream = new DataOutputStream(((java.io.OutputStream) (bytearrayoutputstream)));
                try {
                    dataoutputstream.writeUTF(s);
                    return bytearrayoutputstream.toByteArray();
                } catch (IOException ex) {
                     return null;
                }


        }

        public static boolean isNumstring(String s) {
                for (int i = 0; i < s.length(); i++)
                        if (!Character.isDigit(s.charAt(i)))
                                return false;

                return true;
        }
}
